<template>
  <div></div>
  <el-form :model="form" label-width="auto" style="max-width: 100%">
    <el-form-item label="任务标题">
      <el-input v-model="form.taskTitle" />
    </el-form-item>
    <el-form-item label="任务类型">
      <el-select v-model="form.taskType" placeholder="请选择任务类型">
        <el-option label="待办型" value= 0 />
        <el-option label="通知型" value= 1 />
        <el-option label="计时型" value= 2 />
      </el-select>
    </el-form-item>
    <el-form-item label="任务状态">
      <el-select v-model="form.status" placeholder="请选择任务状态">
        <el-option label="未完成" value= -1 />
        <el-option label="进行中" value= 0 />
        <el-option label="已完成" value= 2 />
      </el-select>
    </el-form-item>
    <el-form-item label="优先级">
      <el-select v-model="form.priority" placeholder="请选择任务优先级">
        <el-option label="不重要不紧急" value= 0 />
        <el-option label="重要不紧急" value= 1 />
        <el-option label="不重要紧急" value= 2 />
        <el-option label="重要且紧急" value= 3 />
      </el-select>
    </el-form-item>
    <el-form-item label="开始时间">
      <el-col :span="11">
        <el-date-picker
            v-model="form.startTime"
            type="date"
            placeholder="Pick a date"
            style="width: 100%"
        />
      </el-col>
      <el-col :span="2" class="text-center">
        <span class="text-gray-500">-</span>
      </el-col>
      <el-col :span="11">
        <el-time-picker
            v-model="form.startTime"
            placeholder="Pick a time"
            style="width: 100%"
        />
      </el-col>
    </el-form-item>
    <el-form-item label="结束时间">
      <el-col :span="11">
        <el-date-picker
            v-model="form.endTime"
            type="date"
            placeholder="Pick a date"
            style="width: 100%"
        />
      </el-col>
      <el-col :span="2" class="text-center">
        <span class="text-gray-500">-</span>
      </el-col>
      <el-col :span="11">
        <el-time-picker
            v-model="form.endTime"
            placeholder="Pick a time"
            style="width: 100%"
        />
      </el-col>
    </el-form-item>

    <el-form-item label="是否重复">
      <el-select v-model="form.isRecurring" placeholder="请选择任务状态">
        <el-option label="不重复" value= 0 />
        <el-option label="每天" value= 1 />
        <el-option label="工作日" value= 2 />
        <el-option label="每周" value= 3 />
        <el-option label="每月" value= 4 />
        <el-option label="每年" value= 5 />
      </el-select>
    </el-form-item>

    <el-form-item label="标签">
      <el-radio-group v-model="form.tag">
        <el-radio value="1">工作</el-radio>
        <el-radio value="2">生活</el-radio>
        <el-radio value="3">购物</el-radio>
        <el-radio value="4">旅行</el-radio>
        <el-radio value="5">学习</el-radio>
        <el-radio value="6">锻炼</el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="任务描述">
      <el-input v-model="form.content" type="textarea" />
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="onSubmit">Create</el-button>
      <el-button>Cancel</el-button>
    </el-form-item>
  </el-form>
</template>

<script lang="ts" setup>
import { reactive } from 'vue'

// do not use same name with ref
const form = reactive({
  taskTitle: '',
  content: '',
  tag: '',
  taskType: '',
  startTime: '',
  endTime: '',
  priority: '',
  status: '',
  experience: '',
  remind1: '',
  remind2: '',
  remind3: '',
  isRecurring: '',
  createdAt: '',
  updatedAt: '',
})

const onSubmit = () => {
  console.log('submit!')
}
</script>
